export const state = () => ({
  datePickerValue: "",
  projectInfo: {},
  floorSiteData: {
    name: "",
    children: []
  },
  inspetionTableData: [],
  tenancyContractData: {},
  areaType: "administrative",   // 项目树地域分类类型
  areaData: {
    areaCode: "",
    gridId: "",
    gridName: "",
    queryType: 0,
    sqCodeList: "",
    geoJson: "",
    areaType: 0,
    areaName: "",
    qjName: ""
  },
  floorData: {
    lzId: "",
    ldzl: "",
    sjytssx: "",
    bxttssx: ""
  },
  gridmanSfid: "",
  // gridmanData: [], // 房管员
  // zlxmData: [], //租赁项目
  // zlqyData: [], //租赁企业
  // jjjgData: [], // 经纪机构
  gridLastData: [], // 现行网格列表
  gridData: [], // 网格列表
  floorGridId: "", // 楼盘所属网格ID
  floorGridmanSfid: "", // 楼盘房管员sfid
  equipmentData: null, //视频设备数据
  panelWindowNum: 1, //当前选择的几画面
  videoCodeArr: [], //视频id数组
  videoTitle: "", //视频弹框的标题
  videoType: { type: "online", start: "", end: "" }, //视频播放类型type:  online在线监控 playBack历史回放, sart end是back回放状态需要的始末时间
  currentVideo: {} //当前视频设备
});
const getters = {
  datePickerValue: state => {
    return state.datePickerValue;
  },
  panelWindowNum: state => {
    return state.panelWindowNum;
  },
  videoTitle: state => {
    return state.videoTitle;
  },
  videoType: state => {
    return state.videoType;
  },
  videoCodeArr: state => {
    return state.videoCodeArr;
  },
  equipmentData: state => {
    return state.equipmentData;
  },
  projectInfo: state => {
    return state.projectInfo;
  },
  floorSiteData: state => {
    return state.floorSiteData;
  },
  inspetionTableData: state => {
    return state.inspetionTableData;
  },
  tenancyContractData: state => {
    return state.tenancyContractData;
  },
  areaType: state => {
    return state.areaType;
  },
  areaData: state => {
    return state.areaData;
  },
  floorData: state => {
    return state.floorData;
  },
  gridmanSfid: state => {
    return state.gridmanSfid;
  },
  // gridmanData: state => {
  //   return state.gridmanData;
  // },
  // zlxmData: state => {
  //   return state.zlxmData;
  // },
  // zlqyData: state => {
  //   return state.zlqyData;
  // },
  // jjjgData: state => {
  //   return state.jjjgData;
  // },
  gridLastData: state => {
    return state.gridLastData;
  },
  gridData: state => {
    return state.gridData;
  },
  floorGridId: state => {
    return state.floorGridId;
  },
  floorGridmanSfid: state => {
    return state.floorGridmanSfid;
  },
  currentVideo: state => {
    return state.currentVideo;
  }
};
const mutations = {
  setDatePickerValue: (state, value) => {
    state.datePickerValue = value;
  },
  setProjectInfo: (state, value) => {
    state.projectInfo = value;
  },
  setEquipmentData: (state, value) => {
    state.equipmentData = value;
  },
  setFloorSiteData: (state, value) => {
    state.floorSiteData = value;
  },
  setinspetionTableData: (state, value) => {
    state.inspetionTableData = value;
  },
  setTenancyContractData: (state, value) => {
    state.tenancyContractData = value;
  },
  setAreaType: (state, value) => {
    state.areaType = value;
  },
  setFloorData: (state, value) => {
    state.floorData = value;
  },
  setAreaData: (state, value) => {
    state.areaData = value;
  },
  setGridmanSfid: (state, value) => {
    state.gridmanSfid = value;
  },
  // setGridmanData: (state, value) => {
  //   state.gridmanData = value;
  // },
  // setZlxmData: (state, value) => {
  //   state.zlxmData = value;
  // },
  // setZlqyData: (state, value) => {
  //   state.zlqyData = value;
  // },
  // setJjjgData: (state, value) => {
  //   state.jjjgData = value;
  // },
  setGridLastData: (state, value) => {
    state.gridLastData = value;
  },
  setGridData: (state, value) => {
    state.gridData = value;
  },
  setFloorGridId: (state, value) => {
    state.floorGridId = value;
  },
  setFloorGridmanSfid: (state, value) => {
    state.floorGridmanSfid = value;
  },
  setPanelWindowNum: (state, value) => {
    state.panelWindowNum = value;
  },
  setVideoCodeArr: (state, value) => {
    state.videoCodeArr = value;
  },
  setVideoTitle: (state, value) => {
    state.videoTitle = value;
  },
  setVideoType: (state, value) => {
    state.videoType = value;
  },
  setCurrentVideo: (state, value) => {
    state.currentVideo = value;
  }
};

export default {
  namespaced: true,
  state,
  getters,
  mutations
};
